﻿/***********************************************************************************************************************************
 *    Name: 
 *  Author: Frank Figearo — http://www.sqlnerd.me/ — frank@sqlnerd.me
 * Summary: 
**/
:SETVAR compatibility_level 
:SETVAR recovery SIMPLE
SELECT N'ALTER DATABASE [' + name + N'] SET RECOVERY $(recovery); ALTER DATABASE [' + name + N'] SET COMPATIBILITY_LEVEL= $(compatibility_level); ALTER AUTHORIZATION ON DATABASE::[' + name + N'] TO DBOwner;'  FROM sys.databases WITH (NOLOCK) WHERE 4 < database_id
GO